import bean.merch;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import utils.c3p0Utils;

import java.sql.SQLException;
import java.util.List;


public class merchtest {
    public static void main(String[] args) throws SQLException {
        QueryRunner runner = new QueryRunner(c3p0Utils.getDataSource());
        String sql = "select * from Merch;";
        List<merch> query = runner.query(sql, new BeanListHandler<merch>(merch.class));

        for (merch h:query){
            System.out.println(h);
        }

        System.out.println();
    }
}
